<?php
//dpm($data);
global $user;
if(empty($data))
    return;
$role = db_query("SELECT * FROM {users_roles WHERE users_roles.uid = %d", $user->uid);
while($r = db_fetch_object($role)) {
    $role_id = $r->rid;
}

?>
<div class="contactsList">
    <form method="post" action="<?php if($role_id==5)echo $base_url . 'promotion_notification';if($role_id==6) echo $base_url . 'campaign_notification';?>">    
<table>
    <tr><th></th><th>name</th><th>E-mail</th><th>Operation</th></tr>
    <?php foreach($data as $value): ?>
        <tr>
            <td><input type="checkbox" name="contacts[]" value="<?php echo $value['email'] . ',' . $value['name']?>"  /></td>
            <td><?php echo $value['name']; ?></td>
            <td><?php echo $value['email']; ?></td>
            <td><a href="<?php echo $base_url.'node/'.$value['nid'].'/edit'?>">Edit</a></td>
        </tr>
    <?php endforeach; ?>
</table>
<input type="submit" value="<?php if($role_id==5) echo 'Send Promotion Notification'; if($role_id==6) echo 'Send Campaign Notification'?> " />    
</div>
</form>